var mysql = require("mysql");

var writeDb = {
  host: "47.103.36.143",
  port: 3310,
  user: "root",
  password: "123456",
  database: "wx_one"
};

var readDb = {
  host: "47.103.36.143",
  port: 3311,
  user: "root",
  password: "123456",
  database: "wx_one"
};

var mycatDb = {
  host: "localhost",
  port: 8066,
  user: "root",
  password: "123456",
  database: "wx_one"
};


//分别把连接改成上面  writeDb   readDb  mycatDb
var connection = mysql.createConnection(mycatDb);

connection.connect();

connection.query("SELECT id,name from user", function(
  error,
  results,
  fields
) {
  if (error) throw error;
  console.log(results, "结果");
});
